<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui">
	
    <h:head />
    
    <h:outputScript name="js/jquery-ui-1.10.4.custom.min.js"/>
    
    <h:body>
	 	<ui:composition>
	 	<div id="content_current">
	 		<h:form id="form">
	 		<p:menubar styleClass="centeredMenuBar">
				<p:menuitem process="pacDT" update=":form:carDetail" style="font-size:12px" icon="ui-icon-contact" value="Informe médico" oncomplete="PF('carDialog').show()" />
				<p:menuitem process="pacDT" update=":form:carDetail" style="font-size:12px" icon="ui-icon-folder-open" value="Expediente anterior" oncomplete="PF('carDialog').show()" />
				<p:menuitem process="pacDT" update=":form:carDetail" style="font-size:12px" icon="ui-icon-signal-diag" value="Laboratorios" oncomplete="PF('carDialog').show()" />
				<p:menuitem process="pacDT" update=":form:carDetail" style="font-size:12px" icon="ui-icon-plusthick" value="Vacunas" oncomplete="PF('carDialog').show()" />
				<p:menuitem process="pacDT" update=":form:carDetail" style="font-size:12px" icon="ui-icon-image" value="Recetas" oncomplete="PF('carDialog').show()" />
			</p:menubar>
			
	 		<!--  widgetVar="beanTable" filteredValue="#{pacListBean.filteredlista}"-->
	 		<h:panelGroup id="panelListaPac" styleClass="ui-panel-lista-datatable">  
				<p:dataTable id="pacDT" var="bean" value="#{pacListBean.lista}" 
					rows="15" paginator="true" paginatorTemplate="{CurrentPageReport}   {PreviousPageLink}  {NextPageLink} " paginatorPosition="bottom"
					selection="#{pacListBean.selectedPac}" selectionMode="single" rowKey="#{bean.id}"> 
                	<f:facet name="header">
			            <p:outputPanel>
			                <h:outputText value="Buscar paciente: " />
			                <p:inputText id="globalFilter" onkeyup="PF('beanTable').filter()" style="width:150px" placeholder="Palabra clave"/>
			            </p:outputPanel>
			        </f:facet>
			        <p:column headerText=" " rendered="false">
			        	<h:outputText value="#{bean.id}" />
			        </p:column>
        			<p:column headerText=" ">
            			<h:outputText value="#{bean.fechaNacimiento}, #{bean.nombrePaciente}" />
            			<br></br>
            			<h:outputText value="#{bean.madre} / #{bean.padre}"  style="font-size:10px"/>
        			</p:column>
        			<p:column headerText=" ">
        				
            			<p:commandButton title="Info. general" style="border-style:hidden;" actionListener="#{dfView.openPacDialog(bean.id)}"
            			icon="ui-generales-image">
    					</p:commandButton>
            			
            			<p:commandButton title="Consultas" style="border-style:hidden;" actionListener="#{dfView.openConDialog()}"
            			icon="ui-consultas-image">
    					</p:commandButton>
            			<!-- <p:commandButton update=":form:carDetail" oncomplete="PF('carDialog').show()" title="Ir a expediente" style="border-style:hidden;"
            			icon="ui-consultas-image">
                			<f:setPropertyActionListener value="#{bean}" target="#{pacListBean.selectedPac}" />
            			</p:commandButton> -->
            			
            			<p:commandButton update=":form:carDetail" oncomplete="PF('carDialog').show()" title="Ver agenda" style="border-style:hidden;"
            			icon="ui-citas-image">
                			<f:setPropertyActionListener value="#{bean}" target="#{pacListBean.selectedPac}" />
            			</p:commandButton>
        				
        			</p:column>
        			
    			</p:dataTable>
    		</h:panelGroup>
    			
    			<p:dialog header="Car Info" widgetVar="carDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
			        <p:outputPanel id="carDetail" style="text-align:center;">
			            <p:panelGrid  columns="2" rendered="#{not empty pacListBean.selectedPac}" columnClasses="label,value">
			 
			                <h:outputText value="Id:" />
			                <h:outputText value="#{pacListBean.selectedPac.nombrePaciente}" />
			 
			                <h:outputText value="Year" />
			                <h:outputText value="#{pacListBean.selectedPac.fechaNacimiento}" />
			 
			 
			                <h:outputText value="Price" />
			                <h:outputText value="$#{dtSelectionView.selectedCar.price}" /> -->
			            </p:panelGrid>
			        </p:outputPanel>
			    </p:dialog>
    
			</h:form>
		</div>
    	</ui:composition>
    	
    </h:body>

</html>